import { useContext } from 'react';
import ThemeContext from './ThemeContext';

export function useTheme() {
  const theme = useContext(ThemeContext);
  // 返回解构后的常用属性
  return {
    colorPrimary: theme.layout?.colorPrimary,
    userAvatar: theme.user?.avatar || '',
    welcomeBg: theme.welcome?.bg || '',
    loginBg: theme.login?.bg || '',
    logo: theme.layout?.logo || '',
    copyright: theme.footer?.copyright || '',
    title: theme.layout?.title || '',
  };
}
